package com.ccb.sc.github.yydzxz.miniprogram.api.impl;

import com.ccb.sc.github.yydzxz.miniprogram.api.IByteDanceMiniProgramMessageService;
import com.ccb.sc.github.yydzxz.miniprogram.api.IByteDanceMiniProgramService;
import com.ccb.sc.github.yydzxz.miniprogram.api.impl.request.message.SendKeFuRequest;
import com.ccb.sc.github.yydzxz.miniprogram.api.impl.request.message.SendSubscribeRequest;
import com.ccb.sc.github.yydzxz.miniprogram.api.impl.response.message.SendKeFuResponse;
import com.ccb.sc.github.yydzxz.miniprogram.api.impl.response.message.SendSubscribeResponse;

public class ByteDanceMiniProgramMessageServiceImpl implements IByteDanceMiniProgramMessageService {

    private final IByteDanceMiniProgramService byteDanceMiniProgramService;

    public ByteDanceMiniProgramMessageServiceImpl(IByteDanceMiniProgramService byteDanceMiniProgramService) {
        this.byteDanceMiniProgramService = byteDanceMiniProgramService;
    }

    @Override
    public SendKeFuResponse send(SendKeFuRequest request) {
        return byteDanceMiniProgramService.post(SEND_KEFU_MESSAGE_URL, request, SendKeFuResponse.class);
    }

    @Override
    public SendSubscribeResponse sendSubscribe(SendSubscribeRequest request) {
        return byteDanceMiniProgramService.post(SEND_SUBSCRIBE_NOTIFICATION_URL, request, SendSubscribeResponse.class);
    }
}
